BIN=test.exe
CC=gcc
SRC=$(wildcard *.c)
OBJ=$(SRC:.c=.o)
LFLAGS=-o
FLAGS=-c
RM=rm -f


# @ ----- not show
# $() --- replace
# $@ ---- obj
# $^ ---- all rely on
# $< ---- the first rely on



$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^ 
	@echo "linking ... $^ to $@"
%.o:%.c
	@$(CC) $(FLAGS) $< -g
	@echo "compling ... $< to $@"
.PHONY:clean
clean:
	@$(RM) $(BIN) $(OBJ) 
	@echo "remove ... $(BIN) $(OBJ) "
.PHONY:test
test:
	@echo $(BIN)
	@echo $(CC)
	@echo $(SRC)
	@echo $(FLAGS)
	@echo $(RM)
